terminology_sources = ['private.h',
                       'about.c', 'about.h',
                       'colors.c', 'colors.h',
                       'config.c', 'config.h',
                       'controls.c', 'controls.h',
                       'ipc.c', 'ipc.h',
                       'keyin.c', 'keyin.h',
                       'main.c', 'main.h',
                       'media.c', 'media.h',
                       'options.c', 'options.h',
                       'options_font.c', 'options_font.h',
                       'options_theme.c', 'options_theme.h',
                       'options_themepv.c', 'options_themepv.h',
                       'options_background.c', 'options_background.h',
                       'options_colors.c', 'options_colors.h',
                       'options_behavior.c', 'options_behavior.h',
                       'options_keys.c', 'options_keys.h',
                       'options_mouse.c', 'options_mouse.h',
                       'options_elm.c', 'options_elm.h',
                       'sel.c', 'sel.h',
                       'miniview.c', 'miniview.h',
                       'termio.c', 'termio.h',
                       'termcmd.c', 'termcmd.h',
                       'term_container.h',
                       'termiointernals.c', 'termiointernals.h',
                       'termiolink.c', 'termiolink.h',
                       'termpty.c', 'termpty.h',
                       'termptydbl.c', 'termptydbl.h',
                       'termptyesc.c', 'termptyesc.h',
                       'termptyops.c', 'termptyops.h',
                       'termptygfx.c', 'termptygfx.h',
                       'termptyext.c', 'termptyext.h',
                       'backlog.c', 'backlog.h',
                       'md5.c', 'md5.h',
                       'utils.c', 'utils.h',
                       'utf8.c', 'utf8.h',
                       'win.c', 'win.h',
                       'theme.c', 'theme.h',
                       'extns.c', 'extns.h',
                       'gravatar.c', 'gravatar.h',
                       'tty_keys.h',
                       'sb.c', 'sb.h']

tybg_sources = ['tycommon.c', 'tycommon.h', 'tybg.c']
tyalpha_sources = ['tycommon.c', 'tycommon.h', 'tyalpha.c']
typop_sources = ['tycommon.c', 'tycommon.h', 'typop.c']
tyq_sources = ['tycommon.c', 'tycommon.h', 'tyq.c']
tycat_sources = ['tycommon.c', 'tycommon.h', 'tycat.c', 'extns.c', 'extns.h']
tyls_sources = ['extns.c', 'extns.h', 'tyls.c', 'tycommon.c', 'tycommon.h']
tysend_sources = ['tycommon.c', 'tycommon.h', 'tysend.c']
tyfuzz_sources = ['termptyesc.c', 'termptyesc.h',
                  'backlog.c', 'backlog.h',
                  'termptyops.c', 'termptyops.h',
                  'termptydbl.c', 'termptydbl.h',
                  'termptyext.c', 'termptyext.h',
                  'termptygfx.c', 'termptygfx.h',
                  'termpty.c', 'termpty.h',
                  'termiointernals.c', 'termiointernals.h',
                  'termiolink.c', 'termiolink.h',
                  'config.c', 'config.h',
                  'colors.c', 'colors.h',
                  'sb.c', 'sb.h',
                  'theme.h',
                  'utils.c', 'utils.h',
                  'utf8.c', 'utf8.h',
                  'tytest_common.c', 'tytest_common.h',
                  'tyfuzz.c']
tytest_sources = ['termptyesc.c', 'termptyesc.h',
                  'backlog.c', 'backlog.h',
                  'termptyops.c', 'termptyops.h',
                  'termptydbl.c', 'termptydbl.h',
                  'termptyext.c', 'termptyext.h',
                  'termptygfx.c', 'termptygfx.h',
                  'termpty.c', 'termpty.h',
                  'termiointernals.c', 'termiointernals.h',
                  'termiolink.c', 'termiolink.h',
                  'config.c', 'config.h',
                  'colors.c', 'colors.h',
                  'extns.c', 'extns.h',
                  'sb.c', 'sb.h',
                  'utf8.c', 'utf8.h',
                  'utils.c', 'utils.h',
                  'theme.h',
                  'md5.c', 'md5.h',
                  'unit_tests.h',
                  'tytest_common.c', 'tytest_common.h',
                  'tytest.c', 'tytest.h']

executable('terminology',
           terminology_sources,
           edj_targets,
           install: true,
           include_directories: config_dir,
           dependencies: terminology_dependencies)
executable('tybg',
           tybg_sources,
           install: true,
           include_directories: config_dir,
           dependencies: terminology_dependencies)
executable('tyalpha',
           tyalpha_sources,
           install: true,
           include_directories: config_dir,
           dependencies: terminology_dependencies)
executable('typop',
           typop_sources,
           install: true,
           include_directories: config_dir,
           dependencies: terminology_dependencies)
executable('tyq',
           tyq_sources,
           install: true,
           include_directories: config_dir,
           dependencies: terminology_dependencies)
executable('tycat',
           tycat_sources,
           install: true,
           include_directories: config_dir,
           dependencies: terminology_dependencies)
executable('tyls',
           tyls_sources,
           install: true,
           include_directories: config_dir,
           dependencies: terminology_dependencies)
executable('tysend',
           tysend_sources,
           install: true,
           include_directories: config_dir,
           dependencies: terminology_dependencies)

if fuzzing
  executable('tyfuzz',
             tyfuzz_sources,
             install: true,
             include_directories: config_dir,
             c_args: '-DBINARY_TYFUZZ=1',
             dependencies: terminology_dependencies)
endif
if tests
  executable('tytest',
             tytest_sources,
             install: true,
             include_directories: config_dir,
             c_args: '-DBINARY_TYTEST=1',
             dependencies: terminology_dependencies)
endif
